package com.lhj.bootdemo.designmode.watcher;

/**
 * @author lhj
 * @version 1.0
 * @date 2022/4/19 10:08 上午
 * @description:
 */

public class Test1 {

    public static void main(String[] args) {
        BusinessServer server = new BusinessServer();
        UserInterface user1 = new UserInterface("张一");
        UserInterface user2 = new UserInterface("张二");
        UserInterface user3 = new UserInterface("张三");
        server.registerObserver(user1);
        server.registerObserver(user2);
        server.registerObserver(user3);
        server.setMsg("发送第一条数据！");

        server.removeObserver(user1);
        server.setMsg("发送第二条数据！");


    }
}
